#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <cstring>
#include <algorithm>
#if 0
using namespace std;
int n, m, ans;
int dx[4] = { 1,2,-2,-1};
int dy[4] = { 2,1,1,2};
void dfs(int x, int y) {
	if (x == n && y == m) {
		ans++;
		return;
	}
	for (int i = 0; i < 4; i++) {
		int ax = x + dx[i];
		int ay = y + dy[i];
		if (ax<0 || ay<0 || ax>n || ay>m) continue;
		// printf("%d %d\n", ax, ay);
		dfs(ax, ay);
	}
}

int main() {
	cin >> n >> m;
	dfs(0, 0);
	cout << ans;
	return 0;
}
#endif